﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.IO;
using System.Web;
using System.Net;

//Need to add list of urls
//Need to add threading to run the test
//Need to add the output per url

namespace TheLoader.classes
{
   
    public class BackGroundBrowser
    {

        public int NumberOfTests { get; set; }
        public TheLoaderTest currentTest { get; set; }

        public void StartRun()
        {

            if (NumberOfTests == 0)
                NumberOfTests = 1;

            
           

            DoAllTests();
            
            
        }

        private void DoAllTests()
        {
            int Count = 0;
            currentTest.bge.SetStartTime();
            while (Count < NumberOfTests)
            {
                Count++;

                currentTest.bge.NumberofRuns = Count;
                currentTest.StartRun();
                
                while (currentTest.IsRunning)
                {

                    System.Threading.Thread.Sleep(0);
                }
                
                
            }
            currentTest.bge.SetEndTime();
            
          
        }

       

       
    }
}
